package pathAlgorithms;

import javax.vecmath.Point2d;

import program.RoboMap;

public class RoboNode {
	
	private Point2d position;
	private RoboMap.Content nodeState;
	
	public static int id;
	private int nodeId;
	
	public RoboNode(Point2d position, RoboMap.Content nodeState) {
		super();
		this.position = position;
		this.nodeState = nodeState;
		nodeId = id++;
	}
		
	public static int getId() {
		return id;
	}

	public RoboMap.Content getNodeState() {
		return nodeState;
	}

	public void setNodeState(RoboMap.Content nodeState) {
		this.nodeState = nodeState;
	}

	public Point2d getPosition() {
		return position;
	}
	
	@Override
	public boolean equals(Object obj) {
		RoboNode otherNode;
		if(obj instanceof RoboNode) {
			otherNode = (RoboNode)obj;
		}else {
			return false;
		}

		return this.position.equals(otherNode.position) && 
				   this.nodeState.equals(otherNode.nodeState);
	}
}
